package string;

public class IndexOfDemo {
    public static void main(String[] args) {
        String str = "thinking in java";
        int index = str.indexOf("in");
        System.out.println(index);
        int index1 = str.indexOf("in", 3);
        System.out.println(index1);
        int index2 = str.lastIndexOf("in");
        System.out.println(index2);
        int index3 = str.lastIndexOf("A");
        System.out.println(index3);
    }
}
